package com.study.d4_thread;

public class Test2_2 {
    public static void main(String[] args) {
        Runnable target = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 4; i++) {
                    System.out.println("子线程1："+i);
                }
            }
        };
        Thread t1 = new Thread(target);
        t1.start();
        new Thread(()-> {
                for (int i = 0; i < 4; i++) {
                    System.out.println("子线程2:"+i);
                }
        }).start();
        for (int i = 0; i < 4; i++) {
            System.out.println("main:"+i);

        }
    }
}
